home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
- EVAL Version 2.3
-
- +++++++++
-
- by McAdams Associates
-
-
-
-
- *****************************************************************
-
-
- **IMPORTANT**
-
- To register Eval, see "Registering Eval" on page 11 of
- this manual.
-
-
-
- Contents Page
- -------- ----
- Description................................ 2
- Running Eval............................... 2
- Removing Eval From Memory.................. 2
- Control Keys............................... 3
- Moving the Window.......................... 4
- Using Eval................................. 5
- Evaluation Order........................... 5
- Inputting Different Number Bases........... 5
- Getting Answers in Different Number Bases.. 6
- Eval's Limits.............................. 7
- Disclaimer & Agreement.....................10
- Registering Eval...........................11
- Index......................................12
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- (C)Copyright 1993 by T.C. McAdams. All Rights Reserved.
- Description
- -----------
-
- EVAL is a pop-up TSR expression evaluator and number base
- conversion program. EVAL can act as both a four-function
- floating point calculator and as a programmer's number base
- converter, translating numbers to and from binary, octal, decimal
- and hexadecimal number bases. Version 2.3 has several new
- features: a "money" type has been added, giving accurate rounding
- to two decimal places; the program will now "get out of your way"
- by moving about the screen; and, since some applications change
- the color palette (sometimes succeeding in making EVAL hard to
- see), EVAL can now change its own colors. Finally, EVAL is now
- able to run in most text modes, including Super-VGA.
-
- EVAL is completely modeless in its operation and dispenses
- entirely with the conventional "pushbutton" calculator paradigm.
- Because of this you are encouraged to read this manual to get the
- most out of EVAL. EVAL should work on any DOS computer running
- DOS 2.1 or above.
-
- Running Eval
- ------------
-
- EVAL can be run as a standalone program by typing
-
- EVAL [ENTER]
-
- at the DOS command line. All of the program's abilities, except
- for the ability to output a result to the running application,
- are available in this mode.
-
- EVAL can be made memory resident by typing
-
- EVAL /r [ENTER]
-
- at the command line. Equally valid would be /R, -r or -R. The
- "R" stands for "resident".
-
- When the program has been successfully loaded into memory and
- made resident, it will beep once. This is EVAL's way of saying
- everything is fine. If you hear TWO beeps, it means that EVAL is
- unable to make itself resident in memory. The main reason for
- this to occur is that a copy of EVAL is already resident. EVAL
- is programmed to "check for itself" before loading to keep from
- using more memory than necessary.
-
- Removing EVAL From Memory
- -------------------------
-
- When it is memory resident, EVAL can be removed from memory by
- typing
-
- EVAL /k [ENTER]
-
-
-
- 2
- where /K, -k and -K are all acceptable. The "K" means "kill from
- memory". If EVAL successfully removes itself from memory you'll
- hear one beep. If the program is unable to remove itself you
- will hear TWO beeps. Possible reasons for this are 1) the
- program was not resident to begin with, 2) a program was loaded
- after EVAL that altered one or more of the interrupts EVAL uses,
- making it impossible to safely change them back to their original
- values. If this happens, the only way to remove EVAL from memory
- is to reboot.
-
- Control Keys
- ------------
-
- If EVAL is memory-resident, the program is invoked by pressing
- [CTRL + SPACE]. This means hold down the [CTRL] key while
- pressing the [SPACE] key. The basic control keys will be seen
- displayed on the bottom lines of the program window:
-
- [ESC]Quit [ENTER]Evaluate [-><-] [Backspace]
- [Home] [End] [Del] [Ins] [F3]Clear [F4]Color
-
- Here's what they all do:
-
- [ESC] Leaves EVAL.
-
- [ENTER] Evaluates the expression inside the number box.
-
- [-><-] The arrow keys move the cursor to the left and right
- within an expression, without erasing any character
- it moves over.
-
- [Backspace] Erases the character to the cursor's immediate left
- and moves the remainder of the expression (anything
- to the right of the cursor) left.
-
- [Home] Moves the block cursor to the far left of the number
- box.
-
- [End] Moves the block cursor to the position immediately
- following the last character of an expression.
-
- [Del] The delete key erases the character under the cursor.
-
- [Ins] The insert key controls the input mode. Insert mode
- is the default, and is shown by the short block
- cursor. If the cursor is moved inside an expression
- and a key is struck in insert mode, that character is inserted
- into the string and all characters to the right are moved one
- space right. Pressing the insert key shifts the mode to
- overstrike and causes the cursor to change appearance (to a large
- block cursor). Typing inside an expression in overstrike mode
- causes the newly typed characters to replace whatever was there
- previously. The Insert key in EVAL operates identically to most
- text editors.
-
-
-
- 3
- [F3] Clears everything inside the number box.
-
- [F4] Changes EVAL's colors.
-
- Not on the menu but nonetheless important, when EVAL is resident
- pressing [CTRL + SPACE] again from inside the program will export
- EVAL's answer to the running application. When EVAL is not
- resident, pressing [CTRL + SPACE] when the program is running is
- the same as pressing [ENTER]. Also, the [F2] key (the
- accumulator key, described below) will serve to recall the result
- of a previous calculation, if EVAL has just been popped up.
-
- After [ENTER] has been pressed, and an answer is displayed, a new
- set of control keys appears:
-
- [ESC]Quit [F1]Expression [F2]Accumulate
- [F3]Clear [F4]Color
-
- [ESC] Same as previously. "Pops down" the program.
-
- [F1] Redisplays the original expression.
-
- [F2] Uses the answer to the last expression as the first
- number of the new.
-
- [F3] Clears everything.
-
- [F4] Changes EVAL's colors.
-
- Moving The Window
- -----------------
-
- EVAL's window can be moved about your screen at any time by
- holding down the [SHIFT] key and pressing one of the cursor
- movement keys:
-
- [SHIFT + ARROW] Moves the window one increment left, right,
- up or down.
-
- [SHIFT + Home] Moves the window to the far left of the
- screen.
-
- [SHIFT + End] Moves the window to the far right of the
- screen.
-
- [SHIFT + PGUP] Moves the window to the top of the screen.
-
- [SHIFT + PGDN] Moves the window to the bottom of the screen.
-
-
-
-
-
-
-
-
-
- 4
- Using EVAL
- ----------
-
- EVAL is a four-function expression evaluator. What this means is
- that instead of merely pushing buttons, you can instead type
- things like
-
- -(32.5+19.5)/16*9.7 [ENTER]
-
- and get as a result -0.335051546391753. Keep reading; all will
- be explained!
-
- Evaluation Order
- ----------------
-
- To get the results you expect from a calculation, you should know
- how EVAL evaluates an expression string. EVAL evaluates from
- left to right, within parentheses, in operator order. Operators
- are always evaluated as follows:
-
- Precedence Operator Action
- -------------------------------------
- 1 * multiplication
- 2 / division
- 3 + addition
- 4 - subtraction
-
- In the previous example, the sub-expression
-
- -(32.5+19.5)
-
- is first to be evaluated, since it is inside parentheses. When
- this is done, the overall expression then looks (to EVAL) like
-
- -52/16*9.7
-
- Next, the 16*9.7 is evaluated (multiplication is done first),
- leaving us with
-
- -52/155.2
-
- which is then evaluated to give the result -0.335051546391753.
-
- Inputting Different Number Bases
- --------------------------------
-
- The earlier example was entirely decimal, or base ten. What
- would happen if we typed
-
- 0xfe57 * 0b110 + 098 * .36 [ENTER] ?
-
- We would get 390666, of course! To explain, the following NUMBER
- PREFIXES are what are used to denote different number bases in
- EVAL:
-
-
-
- 5
- Prefix Number base
- ------------------------------------------------------
- 0b (zero-"b") binary (base 2)
- 0 (zero) octal (base 8)
- d decimal (base 10)
- <nothing> decimal (base 10, default, same as "d")
- 0x (zero-"x") hexadecimal (base 16)
-
- Upper- or lower-case doesn't matter: "0B" is the same as "0b" and
- "0X" is equivalent to "0x". Note that where zeros are used in a
- prefix they must ALWAYS be zeros; letter O's will not work.
-
- The programmers among you will already have noticed that all of
- the prefixes except that for binary are standard C-language
- syntax. No accident, since EVAL was written in C. Since C
- doesn't support binary numbers, however, a prefix had to be
- invented, which is the reason for the "0b".
-
- Note: When a result is output to the running application by
- pressing [CTRL + SPACE], all number prefixes are stripped.
-
- Getting Answers In Different Number Bases
- -----------------------------------------
-
- The number prefixes explained above are for individual numbers.
- So as not to confuse EVAL, a different method has to be used to
- indicate the output, or overall expression, number base. Instead
- of number prefixes, then, we use EXPRESSION PREFIXES, which are
- letters that can be used at the beginning of an expression.
-
- Here are the expression prefixes EVAL recognizes:
-
- Prefix Output
- ---------------------------
- m money
- b binary
- o octal
- d decimal (default)
- h hexadecimal
-
- As before, upper- or lower-case doesn't matter.
-
- The expression prefix "d" (for decimal) is provided for
- consistency, but isn't really necessary since decimal output is
- EVAL's default mode.
-
- Some examples. Typing
-
- B255 [ENTER]
-
- produces 0b11111111, which is 255 in binary (base 2). Typing
-
- h255 [ENTER]
-
- produces 0xff, which is 255 in hexadecimal. And so on.
-
-
- 6
-
- Using the "m" (for "money") expression prefix gives accurate
- rounding to two decimal places. For example, if you wanted to
- compute the total price for an item costing $19.95, and your
- local sales tax is 8.25%, you would input
-
- m19.95*1.0825
-
- and EVAL would return 21.60. If you hadn't used the "m"
- expression prefix, the answer would have been 21.595875.
-
- You can also combine number and expression prefixes in different
- ways:
-
- b0x214*03777+0b11110000 [ENTER]
-
- which gives us an answer of 0b100001001111011011100. See how it
- works: The first character of the expression, "b", is the
- overall expression prefix, specifying base 2 output. The first
- number of the expression has the hexadecimal number prefix "0x",
- the second number the octal "0" prefix and the third number the
- binary "0b" number prefix.
-
- To see how easy things are to change, type the previous example
- into EVAL and press [ENTER]. Then press [F1] (to bring back the
- original expression), [Home] (to move the cursor to the beginning
- of the expression), and [Delete] (to delete the binary expression
- prefix, placing us back into default decimal output mode).
- Hitting [ENTER] again gives the decimal result 1089244.
- Repeating the process, but this time putting an "O" (letter "O",
- for "octal", this time, not zero) expression prefix at the start
- of the expression, gives us the base 8 answer of 04117334.
-
- The main thing to remember, when using EVAL to convert numbers to
- and from various number bases, is the idea of NUMBER PREFIXES and
- EXPRESSION PREFIXES. Number prefixes govern how a number is
- interpreted. Expression prefixes determine how an answer is
- output.
-
- EVAL'S Limits
- -------------
-
- The following is a table of the maximum and minimum values EVAL
- will handle:
-
- Mode Maximum Minimum
- --------------------------------------------------------------
- Money 1000000000000 -1000000000000
- Binary 8589934591 -4294967295
- Octal 5.070602400912918e+030 -6.338253001141147e+029
- Decimal 1.7e+308 -1.7e+308
- <fractions> 1.7e-307 -1.7e-307
- Hex 5.444517870735015e+039 -3.402823669209385e+038
-
-
-
-
- 7
- When these limits are exceeded an overflow or underflow error
- occurs. When this happens, press [F1] to re-edit the original
- expression, or [F3] to clear the number box. When decimal
- numbers become greater than 999999999999999, or smaller than
- -999999999999999, EVAL switches automatically to exponential
- format where, for example, 1.7e+308 means the decimal point
- should be moved 308 places to the right, and 1.7e-30 means the
- decimal point should be moved 30 places left.
-
- Decimal (base 10) is the only number base in which fractional
- numbers are handled. Inputting something like 0xff.f3 would
- result in an answer of 255; everything after the decimal point
- would be ignored.
-
- EVAL's error checking is minimal, in order to save memory, so
- care should be taken not to input a number too large for the
- number base specified by the number prefix. To show what this
- means, if you input 01238 [ENTER], the answer would be 83. Silly
- answer. To see why, input 08 [ENTER]. The answer is zero, since
- the octal number base is comprised only of numerals from 0
- through 7, and EVAL quits parsing (breaking down) a nondecimal
- number when the numeral it's looking at exceeds the specified
- base.
-
- To make things clearer, here are all possible numerals in each
- number base:
-
- Base Possible numbers
- -------------------------------------------------------------
- 2 0, 1
- 8 0, 1, 2, 3, 4, 5, 6, 7
- 10 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
- 16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
-
- In base 16, "number" A is the same as 10 decimal, B represents
- 11, and so on through F = 15.
-
- Since EVAL uses the compiler's floating point math library for
- all decimal (base 10) calculations, the response to inputs beyond
- the base 10 numerals differs from that described for nondecimal
- numbers. For example, inputting e5 (229 hex), without a hex
- number prefix, would be evaluated as 5, since the "e" is skipped
- when EVAL treats it as a decimal number. And 5e is taken to be
- 0, because EVAL thinks it's an exponential format number!
- Generally speaking, assume that if you input nonexistent numbers,
- or nondecimal numbers without the necessary number prefix, you
- will get silly answers in return.
-
- Note for programmers: Since EVAL uses the Microsoft floating
- point math library, bitwise operations are not possible. Bitwise
- shifting can be accomplished, however, by multiplying and
- dividing by powers of two:
-
-
-
-
-
- 8
- Places shifted Number to multiply/divide by
- -----------------------------------------------------
- 1 2
- 2 4
- 3 8
- 4 16
- 5 32
- 6 64
- 7 128
- 8 256
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 9
- Disclaimer & Agreement
- ----------------------
-
- Users of EVAL must accept this disclaimer of warranty:
-
- "EVAL is supplied as is. The author disclaims all warranties,
- expressed or implied, including, without limitation, the
- warranties of merchantability and of fitness for any purpose.
- The author assumes no liability for damages, direct or conse-
- quential, which may result from the use of EVAL."
-
- EVAL is a "shareware program" and is provided at no charge
- to the user for evaluation. Feel free to share it with your
- friends, but please do not give it away altered or as part of
- another system. The essence of "user-supported" software is to
- provide personal computer users with quality software without
- high prices, and yet to provide incentive for programmers to
- continue to develop new products. If you find this program
- useful and find that you are using EVAL and continue to use
- EVAL after a reasonable trial period, you must make a reg-
- istration payment of $20 to McAdams Associates. The $20
- registration fee will license one copy for use on any one
- computer at any one time. You must treat this software just like
- a book. An example is that this software may be used by any
- number of people and may be freely moved from one computer
- location to another, so long as there is no possibility of it
- being used at one location while it's being used at another.
- Just as a book cannot be read by two different persons at the
- same time.
-
- Commercial users of EVAL must register and pay for their
- copies of EVAL within 30 days of first use or their license
- is withdrawn. Site-License arrangements may be made by con-
- tacting McAdams Associates.
-
- Anyone distributing EVAL for any kind of remuneration must
- first contact McAdams Associates at the address below for
- authorization. This authorization will be automatically granted
- to distributors recognized by the ASP as adhering to its
- guidelines for shareware distributors, and such distributors may
- begin offering EVAL immediately (However McAdams Associates must
- still be advised so that the distributor can be kept up-to-date
- with the latest version of EVAL.).
-
- You are encouraged to pass a copy of EVAL along to your
- friends for evaluation. Please encourage them to register their
- copy if they find that they can use it.
-
- Since this is shareware and I am a member of the Association of
- Shareware Professionals, please read the following:
-
- "This program is produced by a member of the
- Association of Shareware Professionals (ASP). ASP
- wants to make sure that the shareware principle works
- for you. If you are unable to resolve a shareware-
-
-
- 10
- related problem with an ASP member by contacting the
- member directly, ASP may be able to help. The ASP
- Ombudsman can help you resolve a dispute or problem
- with an ASP member, but does not provide technical
- support for members' products. Please write to the ASP
- Ombudsman at 545 Grover Road, Muskegon, MI USA 49442-
- 9427, FAX 616-788-2765, or send a CompuServe mail
- message to ASP Ombudsman 70007,3536."
-
- Registering EVAL
- ----------------
-
- Registering EVAL costs $20 and includes one year's free support
- by phone, mail and CompuServe e-mail, free bug fixes, the latest
- version of EVAL, a typeset manual, plus TWO handy disk utility
- program: 1) SEARCH, a multitalented disk scanning file-finder
- program, and 2) TO/RET, a "two-in-one" combo that work together,
- enabling you to change to any disk/directory and return instantly
- to your starting point.
-
- To register EVAL, simply print and fill out the file REGISTER.DOC
- and send it, along with $20 (checks or M.O.s drawn on a U.S. bank
- only, please) to:
-
- McAdams Associates
- P.O. Box 835505
- Richardson, TX 75083-5505
-
- CIS PPN 70353,1644
-
-
- -----------------------------------------------------------------
-
-
- EVAL was created using QuickC and MASM, which are trademarks of
- Microsoft Corporation.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 11
- Index
- -----
-
-
- [-><-] arrow keys
- for moving window, 4
- inside number box, 3
- Accumulator, see [F2]
- Answers in different bases, 5
- Beeps
- one, signifying success, 2, 3
- two, signifying failure, 2, 3
- Bit-shifting (simulating), 8
- Clearing the program box, see [F3]
- Colors (changing), see [F4]
- Control keys, 3
- [CTRL + SPACE] key
- from inside EVAL, 4
- initial hotkey, 3
- [DELETE] key, 3
- Description, 2
- Editing an expression, see Control keys
- [END] key, 3
- [ENTER] key, 3
- Errors
- number base, 8
- overflow, 7
- underflow, 7
- [ESC] key, 3
- EVAL compatibility, 2
- EVAL's limits, 7-8
- Evaluation order, 5
- Expression prefixes, 6-7
- [F1] key, 4
- [F2] key, 4
- [F3] key, 4
- [F4] key, 4
- Getting an answer, see [ENTER]
- [Home] key, 3
- Hotkey (for popping up), see [CTRL + SPACE]
- Inputting a number/expression, 5
- [INSERT] key, 3
- Moving the window, 4
- Number prefixes, 5-6
- Numerals (all possible), 8
- Operator precedence, 5
- [PGUP] key, 4
- [PGDN] key, 4
- Recalling original expression, see [F1]
- Registering EVAL, 11
- Running EVAL
- from the command line, 2
- when memory resident, 2
- [SHIFT] key, 4
- Using EVAL, 5
-
-
- 12
-